package com.frostmourne.arkattribute;

import com.frostmourne.arkattribute.Listener.Listener$1;
import com.frostmourne.arkattribute.Listener.Listener$2;
import com.frostmourne.arkattribute.Listener.Listener$3;
import org.bukkit.Bukkit;
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.event.Listener;
import org.bukkit.plugin.java.JavaPlugin;

public final class ArkAttribute extends JavaPlugin {

    private static ArkAttribute plugin = null;
    public static ArkAttribute getMain() {return plugin;}

    @Override
    public void onEnable() {
     plugin = this;
     saveDefaultConfig();
     RegListener(new Listener$1());
     RegListener(new Listener$2());
     RegListener(new Listener$3());
     Log("[ArkAttribute]插件已加载");
     Log("[ArkAttribute]当前注册的属性");
     Log(String.valueOf(this.getConfig().getConfigurationSection("属性标签").getKeys(false)));
    }


    public void Log(String log){
        Bukkit.getConsoleSender().sendMessage(log);
    }

    public void RegListener(Listener listener){
        Bukkit.getPluginManager().registerEvents(listener , this);
    }


    @Override
    public void onDisable() {
        // Plugin shutdown logic
    }
}
